package com.io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class PWDemo2 {
    public static void main(String[] args) throws FileNotFoundException {
        //fos是字节流，低级流
        FileOutputStream fos = new FileOutputStream("./pwd2.txt",true);

        //osw是字符流，高级流，可以指定编码
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);

        //bw是字符流，高级流，可以自动刷新
        BufferedWriter bw = new BufferedWriter(osw,8192);

        //pw是字符流，高级流，可以自动刷新
        PrintWriter pw = new PrintWriter(bw);
        pw.println("你好");
        pw.println("世界");
        System.out.println("ok");
        pw.close();


    }
}
